<?php
/** @var ContactoController $this */
/** @var Contacto $model */
$this->pageTitle = TareaEtapa::label(2);
$etapa = $model->activos()->search();
$this->menu = array(
    array('label' => Yii::t('AweCrud.app', 'Create'), 'icon' => 'plus', 'url' => array('create')),
);
?>
<div class="widget blue">
    <div class="widget-title">
        <h4><i class="icon-book"></i> <?php echo Yii::t('AweCrud.app', 'Manage') ?> <?php echo TareaEtapa::label(2) ?></h4>
        <span class="tools">
            <a href="javascript:;" class="icon-chevron-down"></a>
        </span>
    </div>
    <div class="widget-body form">
        <?php $this->widget('ext.yiiSortableModel.widgets.SortableCGridView', array(
            'id'=> 'tarea-etapa-grid',
            'type' => 'striped bordered hover advance',
            'dataProvider' => $etapa,
            'orderField' => 'peso',
            'idField' => 'id',
            'orderUrl' => 'reordenar',
            'columns'=> array(
//                'peso',
                array(
                    'name' => 'nombre',
                    'type' => 'html',
                    'value' => '"<i class=\'icon-move\'></i> ".$data->nombre'
                ),
                array(
                    'name' => 'porcentaje',
                    'type' => 'html',
                    'value' => '$data->porcentaje."%"'
                ),
                array(
                    'class' => 'CButtonColumn',
                    'template' => '{update} {delete}',
                    'buttons' => array(
                        'update' => array(
                            'label' => '<button class="btn btn-primary"><i class="icon-pencil"></i></button>',
                            'options' => array('title' => 'Actualizar'),
                            'imageUrl' => false,
                        ),
                        'delete' => array(
                            'label' => '<button class="btn btn-danger"><i class="icon-trash"></i></button>',
                            'options' => array('title' => 'Eliminar','onClick'=>'js:location.reload();'),
                            'imageUrl' => false,
                        ),
                    ),
                    'htmlOptions' => array(
                        'width' => '80px'
                    )
                ),
            ),
        ));?>
    </div>
</div>